gtktextview: Add a missing g_assert_not_reached() for switch default
authorPhilip Withnall <withnall@endlessm.com>
Tue, 10 Oct 2017 17:29:36 +0000 (18:29 +0100)
committerPhilip Withnall <withnall@endlessm.com>
Wed, 11 Oct 2017 16:26:54 +0000 (17:26 +0100)
Clarifies the code and helps catch invalid enum values before they
propagate further. Also add a comment about why two seemingly legitimate
values are not handled there (they’re handled higher up in the file).

Coverity CID: 1457700

Signed-off-by: Philip Withnall <withnall@endlessm.com>
https://bugzilla.gnome.org/show_bug.cgi?id=788787

gtk/gtktextview.c

index 64c4cfdb61354dc3751172d254ea1a3e0b14327d..2ea2e85160fc871d1a0e6877fb798ad17fdb0c4b 100644 (file)
@@ -6559,7 +6559,9 @@ gtk_text_view_move_cursor (GtkTextView     *text_view,
       
     case GTK_MOVEMENT_PAGES:
     case GTK_MOVEMENT_HORIZONTAL_PAGES:
+      /* We handle these cases above and return early from them. */
     default:
+      g_assert_not_reached ();
       break;
     }